//
//  DealerAddressAnnotation.m
//  WDFans
//
//  Created by zhyuan on 7/28/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "DealerAddressAnnotation.h"
#import "WDDealer.h"

@implementation DealerAddressAnnotation
@synthesize dealer;

-(id)initWithDealer:(WDDealer *)deal;
{
	if(self = [super init])
	{
		self.dealer = deal;
	}
	return self;
}

- (CLLocationCoordinate2D)coordinate;
{
    CLLocationCoordinate2D theCoordinate;
    theCoordinate.latitude = self.dealer.lattitude;
    theCoordinate.longitude = self.dealer.longitude;
    return theCoordinate; 
}

// required if you set the MKPinAnnotationView's "canShowCallout" property to YES
- (NSString *)title
{
    return self.dealer.name;
}

// optional
- (NSString *)subtitle
{
    return self.dealer.address;
}

- (void)dealloc
{
    [dealer release];
    [super dealloc];
}
@end
